{
	template:`
    <a-card :hoverable="true" :bodyStyle="{padding:'20px 20px 0'}" style="margin:0 15px 15px;">
        <a-form class="index-form" :wrapper-col="{span:24}">
            <a-row :gutter="10">
                <a-col :span="8">
                    <a-form-item label="项目编号" class="index-form-item" required>
                        <a-input v-if="edit" v-model:value="model.itemNum" />
                        <span v-else>{{model.itemNum}}</span>
                    </a-form-item>
                </a-col>
                <a-col :span="16">
                    <a-form-item label="项目名称" class="index-form-item" required>
                        <a-input v-model:value="model.itemName" />
                    </a-form-item>
                </a-col>
                <a-col :span="24">
                    <a-form-item label="项目内容" class="index-form-item">
                        <a-textarea v-model:value="model.itemContent"  auto-size/>
                    </a-form-item>
                </a-col>
                <a-col :span="8">
                    <a-form-item label="项目级别" class="index-form-item">
                        <a-input-number v-model:value="model.level" />
                    </a-form-item>
                </a-col>
                <a-col :span="8">
                    <a-form-item label="项目状态" class="index-form-item">
                        <a-select v-model:value="model.itemStatus"  :options="dictOptions('flowItemStatus')" show-search :filter-option="selectFilter"/>
                    </a-form-item>
                </a-col>
                <a-col :span="8">
                    <a-form-item label="金额" class="index-form-item">
                        <a-input-number v-model:value="model.amount" />
                    </a-form-item>
                </a-col>
                <a-col :span="8">
                    <a-form-item label="开始时间" class="index-form-item">
                        <a-date-picker v-model:value="model.startDate"  format="YYYY-MM-DD" valueFormat="YYYY-MM-DD" style="width:100%;" />
                    </a-form-item>
                </a-col>
                <a-col :span="8">
                    <a-form-item label="结束时间" class="index-form-item">
                        <a-date-picker v-model:value="model.endDate"  format="YYYY-MM-DD" valueFormat="YYYY-MM-DD" style="width:100%;" />
                    </a-form-item>
                </a-col>
                <a-col :span="8">
                    <a-form-item label="流程状态" class="index-form-item">
                        {{dict('flow.model.FlowItemTest!flowStatus',model.flowStatus)}}:{{model.flowRemark}}
                    </a-form-item>
                </a-col>
                <a-col :span="8">
                    <a-form-item label="负责部门" class="index-form-item" required>
                        <select-tree v-model:value="model.dutyOrg.oid" dict="manage.model.AdminGroup:C" placeholder="请选择负责部门"/>
                    </a-form-item>
                </a-col>
                <a-col :span="16">
                    <a-form-item label="参加部门" class="index-form-item">
                        <select-tree v-model:value="model.joinOrg" dict="manage.model.AdminGroup:C" multiple placeholder="请选择参加部门"/>
                    </a-form-item>
                </a-col>
                <a-col :span="8">
                    <a-form-item label="负责人" class="index-form-item" required>
                        <select-item v-model:value="model.dutyUser.oid" :dict="'manage.model.AdminLogin:'+model.dutyOrg.oid" placeholder="请选择负责人"/>
                    </a-form-item>
                </a-col>
                <a-col :span="16">
                    <a-form-item label="参加人" class="index-form-item">
                        <select-item v-model:value="model.joinUser" :dict="'manage.model.AdminLogin:'+model.joinOrg" multiple placeholder="请选择参加人"/>
                    </a-form-item>
                </a-col>
                <a-col :span="8">
                    <a-form-item label="申请人" class="index-form-item">
                        {{model.applyUser.realname}}
                    </a-form-item>
                </a-col>
                <a-col :span="8">
                    <a-form-item label="申请部门" class="index-form-item">
                        {{model.applyOrg.name}}
                    </a-form-item>
                </a-col>
                <a-col :span="8">
                    <a-form-item label="创建时间" class="index-form-item">
                        {{model.createDate}}
                    </a-form-item>
                </a-col>
            </a-row>
        </a-form>
    </a-card>
	`,
	props: ['localeZh','param','parentVue'],
	data:function(){
		return {
			model:{"dutyUser":{},"dutyOrg":{},"applyUser":{},"applyOrg":{}},
			edit:false,
			initOver:false
		};
	},
	mounted(){
	    this.model=this.param.model;
	    this.edit=this.param.edit;
	    this.$nextTick(()=>{
	        this.initOver=true;
	        this.flowNextHandler();
	    });
	},
	watch:{
	    'model.dutyUser.oid':function(){
	        this.flowNextHandler();
	    },
	    'model.dutyOrg.oid':function(){
	        if(this.initOver) this.model.dutyUser={};
	        this.flowNextHandler();
	    },
	    'model.joinOrg':function(){
	        this.model.joinUser=[];
	    }
	},
	methods:{
	    //实现方法，流程提交时使用
	    getFlowModel:function(){
	        if(!this.model.itemNum) return "项目编号不能为空";
	        if(!this.model.itemName) return "项目名称不能为空";
	        if(!this.model.dutyOrg.oid) return "请选择负责部门";
	        if(!this.model.dutyUser.oid) return "请选择负责人";
            return this.model;
	    },
	    //实现方法，流程页面变动时使用
	    flowNextHandler:function(){
	        console.log(this.model.dutyUser.oid);
	        console.log(this.parentVue.getInstance());
	        console.log(this.parentVue.getNextSection());
	        if(this.parentVue.getInstance().currentSection.name=='部门审核'){
	            //调整原流程设定
	            this.parentVue.setOrgGroup([this.model.dutyOrg.oid]);
	            //设置默认下一步人
	            this.parentVue.setUserList([this.model.dutyUser.oid]);
	        }
	    }
	}
}